package com.project.zsxd.server.common.exception;

import com.project.zsxd.server.common.enums.ResultEnum;

/**
 * Created by kaler on 2020/5/12.
 */
public class SystemException  extends RuntimeException{

    private String errorCode;
    private String errorMessage;
    private Exception exception;

    public SystemException(ResultEnum resultEnum) {
        super();
        this.errorCode = resultEnum.getCode();
        this.errorMessage = resultEnum.getMessage();
    }

    public SystemException(ResultEnum resultEnum, Exception exception) {
        super(exception);
        this.errorCode = resultEnum.getCode();
        this.errorMessage = resultEnum.getMessage();
        this.exception = exception;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public Exception getException() {
        return exception;
    }

}
